# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Metastore.V1beta.Model.RestoreServiceRequest do
  @moduledoc """
  Request message for DataprocMetastore.RestoreService.

  ## Attributes

  *   `backup` (*type:* `String.t`, *default:* `nil`) - Optional. The relative resource name of the metastore service backup to restore from, in the following form:projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}. Mutually exclusive with backup_location, and exactly one of the two must be set.
  *   `backupLocation` (*type:* `String.t`, *default:* `nil`) - Optional. A Cloud Storage URI specifying the location of the backup artifacts, namely - backup avro files under "avro/", backup_metastore.json and service.json, in the following form:gs://. Mutually exclusive with backup, and exactly one of the two must be set.
  *   `requestId` (*type:* `String.t`, *default:* `nil`) - Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format). A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
  *   `restoreType` (*type:* `String.t`, *default:* `nil`) - Optional. The type of restore. If unspecified, defaults to METADATA_ONLY.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :backup => String.t() | nil,
          :backupLocation => String.t() | nil,
          :requestId => String.t() | nil,
          :restoreType => String.t() | nil
        }

  field(:backup)
  field(:backupLocation)
  field(:requestId)
  field(:restoreType)
end

defimpl Poison.Decoder, for: GoogleApi.Metastore.V1beta.Model.RestoreServiceRequest do
  def decode(value, options) do
    GoogleApi.Metastore.V1beta.Model.RestoreServiceRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Metastore.V1beta.Model.RestoreServiceRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
